﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<%
checkadmin(4)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户列表</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
</head>
<body>
 <div class="addrecord"><ul><li><a href="user_add.asp">添加用户</a></li></ul></div>
<table cellspacing="0" cellpadding="0" class="table_800">
<tr>
    <th class='tdcenter'>序号</th>
	<th class='tdcenter'>用户名</th>
	<th class='tdcenter'>管理级别</th>
	<th class='tdcenter'>登录IP</th>
	<th class='tdcenter'>登录时间</th>
	<th class='tdcenter'>操作</th>
</tr>
<%
dim page,sql,MyPage,rs,u_level,u_strLevel
page=GetIntQueryString("page")
sql = "select * from [c_user] where level<=4"
if page<=1 then
page = 1
end if
Set MyPage = New RZPage
MyPage.SetSQL = sql
MyPage.PageSize = 20
MyPage.SetCss_PreNext="nextprev"
MyPage.SetCss_NumPage="pagenum"
MyPage.SetCss_CurrentPage="currentpage"
Set rs = MyPage.GetRS()
dim i
For i=1 To MyPage.PageSize
If Not rs.EOF Then 
u_level=rs("level")
Select Case u_level
	Case 1
		u_strLevel="普通管理员"
	Case 4
		u_strLevel="系统管理员"
	Case Else
		u_strLevel="未配置"
End Select
%> 
<tr  class="row">
<td>
<%
if page<=1 then 
response.write(i)
else
response.write((page-1)*MyPage.PageSize+i)
end if 
%>
</td>
<td class='tdcenter'><%=rs("name")%></td>
<td class='tdcenter'><%=u_strLevel%></td>
<td class='tdcenter'><%=rs("ip")%></td>
<td class='tdcenter'><%=rs("logintime")%></td>
<td class='tdcenter'><%if rs("name")<>session("user_name") then%><a href="user_edit.asp?id=<%=rs("id")%>">修改</a>&nbsp;<a  onclick="return confirm('您确定要删除吗？');" href="user_delete.asp?id=<%=rs("id")%>">删除</a><%end if%></td>
</tr>
<%
rs.Movenext
Else
Exit For
End If
Next
%>
</table>
<div id="bottompage">
<%MyPage.ShowPage()%>
<span class="recordcount">
<%MyPage.ShowPageInfo()%>
</span>
</div>
</body>
</html>